@editora/plugins 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +5 -0
  2. package/dist/_commonjsHelpers-6763f629.js +1 -0
  3. package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +98 -80
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +128 -115
  8. package/dist/anchoredPopover-33f1358d.mjs +109 -0
  9. package/dist/anchoredPopover-8151d535.js +1 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +249 -208
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +68 -55
  14. package/dist/blockquote.esm.js +2 -1
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +245 -178
  17. package/dist/capitalization.esm.js +2 -1
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +82 -58
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +512 -439
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +33 -27
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +93 -82
  26. package/dist/code.cjs.js +32 -32
  27. package/dist/code.esm.js +653 -594
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +158 -116
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +432 -371
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +159 -105
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +368 -328
  36. package/dist/direction.esm.js +18 -9
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +308 -240
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +5 -4
  41. package/dist/documentManager-25b6203c.mjs +9122 -0
  42. package/dist/documentManager-b69e7054.js +17 -0
  43. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +81 -73
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +77 -65
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +56 -54
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +47 -39
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +53 -37
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +117 -76
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +92 -70
  58. package/dist/html2canvas.esm-09133e29.js +22 -0
  59. package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +24 -12
  62. package/dist/index-656d224b.js +231 -0
  63. package/dist/index-6a8c48bb.js +1 -0
  64. package/dist/index-d027b7e2.mjs +16859 -0
  65. package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-730f2d98.mjs +5775 -0
  68. package/dist/index.es-dd40173b.js +18 -0
  69. package/dist/index.esm.js +128 -125
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +9 -8
  72. package/dist/jspdf.es.min-90db2c97.js +243 -0
  73. package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +24 -11
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +30 -24
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +25 -20
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +61 -59
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +146 -139
  84. package/dist/media-manager.cjs.js +38 -38
  85. package/dist/media-manager.esm.js +325 -308
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +286 -238
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +216 -177
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +49 -33
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +463 -393
  94. package/dist/preview.esm.js +10 -5
  95. package/dist/print.cjs.js +4 -4
  96. package/dist/print.esm.js +20 -17
  97. package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
  98. package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
  99. package/dist/slash-commands.cjs.js +3 -3
  100. package/dist/slash-commands.esm.js +212 -176
  101. package/dist/smart-paste.cjs.js +27 -27
  102. package/dist/smart-paste.esm.js +336 -280
  103. package/dist/special-characters.cjs.js +7 -7
  104. package/dist/special-characters.esm.js +69 -61
  105. package/dist/spell-check.cjs.js +5 -5
  106. package/dist/spell-check.esm.js +123 -97
  107. package/dist/strikethrough.cjs.js +1 -1
  108. package/dist/strikethrough.esm.js +19 -14
  109. package/dist/style.css +1 -0
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +225 -191
  112. package/dist/template.cjs.js +11 -11
  113. package/dist/template.esm.js +153 -124
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +27 -21
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +87 -70
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +162 -100
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +678 -602
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +157 -128
  124. package/package.json +13 -7
  125. package/LICENSE +0 -21
  126. package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
  127. package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
  128. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  129. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  130. package/dist/documentManager-CTqRftU8.mjs +0 -8369
  131. package/dist/documentManager-Jf0RbSks.js +0 -17
  132. package/dist/html2canvas.esm-B5qzocYs.js +0 -5
  133. package/dist/index-CvJk4DKa.js +0 -221
  134. package/dist/index-D3CycEFU.mjs +0 -16543
  135. package/dist/index-tqLTHcO6.js +0 -1
  136. package/dist/index.es-CE_A4QSm.js +0 -5
  137. package/dist/index.es-DQ78mYYo.mjs +0 -6665
  138. package/dist/jspdf.es.min-BoS80556.js +0 -77
  139. package/dist/plugins.css +0 -1
  140. /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # @editora/plugins
2
2
 
3
+ > [!IMPORTANT]
4
+ > **Live Website:** https://editora-ecosystem.netlify.app/
5
+ > **Storybook:** https://editora-ecosystem-storybook.netlify.app/
6
+
7
+
3
8
  <div align="center">
4
9
  <img src="../../images/editora_logo_blocks.svg" alt="Editora Logo" width="200" height="auto">
5
10
  </div>
@@ -0,0 +1 @@
1
+ "use strict";var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t}exports.commonjsGlobal=u;exports.getAugmentedNamespace=l;exports.getDefaultExportFromCjs=f;
@@ -0,0 +1,30 @@
1
+ var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function f(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ function l(e) {
6
+ if (e.__esModule)
7
+ return e;
8
+ var r = e.default;
9
+ if (typeof r == "function") {
10
+ var t = function o() {
11
+ return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
12
+ };
13
+ t.prototype = r.prototype;
14
+ } else
15
+ t = {};
16
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
17
+ var n = Object.getOwnPropertyDescriptor(e, o);
18
+ Object.defineProperty(t, o, n.get ? n : {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return e[o];
22
+ }
23
+ });
24
+ }), t;
25
+ }
26
+ export {
27
+ l as a,
28
+ u as c,
29
+ f as g
30
+ };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=new Set,v=[],f=t=>{v.push(t)},x='[data-theme="dark"], .dark, .editora-theme-dark';f({id:"image-alt-text",wcag:"1.1.1",description:"Images must have alt text",severity:"error",selector:"img",evaluate(t,n){const e=t;return e.hasAttribute("role")&&e.getAttribute("role")==="presentation"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="image-alt-text"?null:!e.hasAttribute("alt")||e.getAttribute("alt")?.trim()===""?{id:`img-alt-${n.cache.get("imgIdx")}`,rule:"image-alt-text",wcag:"1.1.1",severity:"error",message:"Image missing alt text",nodePath:n.cache.get("imgPath"),element:e,suggestion:"Add descriptive alt text to all images",fixable:!0,fixLabel:"Add empty alt"}:null},fix(t){t.element&&t.element.setAttribute("alt","")}});f({id:"empty-interactive",wcag:"4.1.2",description:"Interactive elements must have accessible names",severity:"error",selector:'button, a, [role="button"]',evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="empty-interactive")return null;const r=e.textContent?.trim(),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby"),s=e.hasAttribute("title");return!r&&!a&&!o&&!s?{id:`interactive-empty-${n.cache.get("buttonIdx")}`,rule:"empty-interactive",wcag:"4.1.2",severity:"error",message:"Interactive element has no accessible name",nodePath:n.cache.get("buttonPath"),element:e,suggestion:"Add text, aria-label, aria-labelledby, or title",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Button")}});f({id:"form-label",wcag:"1.3.1",description:"Form controls must have labels",severity:"error",selector:"input, textarea, select",evaluate(t,n){const e=t;if(e.hasAttribute("type")&&e.getAttribute("type")==="hidden"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="form-label")return null;const r=n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby");return!r&&!a&&!o?{id:`form-label-${n.cache.get("inputIdx")}`,rule:"form-label",wcag:"1.3.1",severity:"error",message:"Form control missing label",nodePath:n.cache.get("inputPath"),element:e,suggestion:"Add <label>, aria-label, or aria-labelledby",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Input")}});f({id:"table-headers",wcag:"1.3.1",description:"Tables must have header rows",severity:"error",selector:"table",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="table-headers")return null;const r=e.querySelectorAll("th"),a=e.querySelectorAll("tr");return r.length===0&&a.length>0?{id:`table-no-headers-${n.cache.get("tableIdx")}`,rule:"table-headers",wcag:"1.3.1",severity:"error",message:"Table missing header row (<th> elements)",nodePath:n.cache.get("tablePath"),element:e,suggestion:"Add <th> elements to first row",fixable:!0,fixLabel:"Convert first row to headers"}:null},fix(t){if(t.element){const e=t.element.querySelector("tr");e&&Array.from(e.children).forEach(r=>{if(r.tagName==="TD"){const a=document.createElement("th");a.innerHTML=r.innerHTML,e.replaceChild(a,r)}})}}});f({id:"heading-empty",wcag:"1.3.1",description:"Headings must not be empty",severity:"error",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="heading-empty")return null;const r=e.textContent?.replace(/\s+/g,"")||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR";return!r&&!a?{id:`heading-empty-${n.cache.get("headingIdx")}`,rule:"heading-empty",wcag:"1.3.1",severity:"error",message:`Empty ${e.tagName.toLowerCase()} heading`,nodePath:n.cache.get("headingPath"),element:e,suggestion:"All headings must contain text",fixable:!1}:null}});f({id:"heading-order",wcag:"1.3.1",description:"Headings should not skip levels",severity:"warning",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t,r=parseInt(e.tagName[1]),a=n.cache.get("previousHeadingLevel")||r;return n.cache.set("previousHeadingLevel",r),r-a>1?{id:`heading-order-${n.cache.get("headingIdx")}`,rule:"heading-order",wcag:"1.3.1",severity:"warning",message:`Heading skips level (${a} → ${r})`,nodePath:n.cache.get("headingPath"),element:e,suggestion:`Use heading level ${a+1} instead`,fixable:!1}:null}});f({id:"link-text",wcag:"2.4.4",description:"Links must have descriptive text",severity:"error",selector:"a",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="link-text")return null;const r=e.textContent?.replace(/\s+/g,"").toLowerCase()||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR",o=["clickhere","readmore","link","here","this","page"];return!r&&!a?{id:`link-empty-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"error",message:"Link has no text content",nodePath:n.cache.get("aPath"),element:e,suggestion:"All links must have descriptive text",fixable:!0,fixLabel:"Insert placeholder"}:o.some(s=>r.includes(s))?{id:`link-vague-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"warning",message:`Vague link text: "${e.textContent?.trim()}"`,nodePath:n.cache.get("aPath"),element:e,suggestion:"Use descriptive link text",fixable:!1}:null},fix(t){t.element&&(t.element.textContent="Link")}});f({id:"list-structure",wcag:"1.3.1",description:"Lists must only contain <li> children",severity:"error",selector:"ul, ol",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="list-structure")return null;const r=e.querySelectorAll(":scope > li");return Array.from(e.children).filter(o=>o.tagName!=="LI").length>0?{id:`list-structure-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"error",message:"List contains non-li elements",nodePath:n.cache.get("ulPath"),element:e,suggestion:"All direct children of ul/ol must be li elements",fixable:!1}:r.length===0?{id:`list-empty-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"warning",message:"Empty list element",nodePath:n.cache.get("ulPath"),element:e,suggestion:"Remove empty lists or add list items",fixable:!1}:null}});const A=()=>{const t=window.getSelection();if(t&&t.rangeCount>0){let e=t.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const r=e;if(r.getAttribute("contenteditable")==="true")return r}e=e.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const e=n.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},T=()=>{if(A()?.closest(x))return!0;const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).startContainer;if((r.nodeType===Node.ELEMENT_NODE?r:r.parentElement)?.closest(x))return!0}return document.activeElement?.closest(x)?!0:document.body.matches(x)||document.documentElement.matches(x)},w=()=>{const t=A();if(!t)return[];const n=[],e={doc:t.ownerDocument||document,cache:new Map},r=e.doc.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let a=r.currentNode,o={},s={},p=0;for(;a&&p<5e3;){const h=a,i=h.tagName?.toLowerCase?.()||"";if(h.hidden||h.style.display==="none"||h.style.visibility==="hidden"){a=r.nextNode(),p++;continue}o[i]=(o[i]||0)+1,s[i]=`${i}[${o[i]-1}]`;for(const u of v){if(B.has(u.id)||u.selector&&!a.matches?.(u.selector))continue;e.cache.set(`${i}Idx`,o[i]-1),e.cache.set(`${i}Path`,s[i]),/^h[1-6]$/.test(i)&&(e.cache.set("headingIdx",o[i]-1),e.cache.set("headingPath",s[i])),i==="a"&&(e.cache.set("aIdx",o[i]-1),e.cache.set("aPath",s[i])),i==="table"&&(e.cache.set("tableIdx",o[i]-1),e.cache.set("tablePath",s[i])),i==="button"&&(e.cache.set("buttonIdx",o[i]-1),e.cache.set("buttonPath",s[i])),i==="input"&&(e.cache.set("inputIdx",o[i]-1),e.cache.set("inputPath",s[i])),(i==="ul"||i==="ol")&&(e.cache.set("ulIdx",o[i]-1),e.cache.set("ulPath",s[i]));const m=u.evaluate(a,e);m&&n.push(m)}a=r.nextNode(),p++}return n},b=(t,n=!0)=>{t.element&&(n?(t.element.classList.add("a11y-highlighted"),t.element.style.outline="2px solid #ff9800",t.element.style.backgroundColor="#fff3cd"):(t.element.classList.remove("a11y-highlighted"),t.element.style.outline="",t.element.style.backgroundColor=""))},I=t=>{t||(t=w());const n=t.filter(a=>a.severity==="error").length,e=t.filter(a=>a.severity==="warning").length;let r=100-n*20-e*5;return Math.max(0,r)},P=t=>{const n=v.find(e=>e.id===t.rule);n&&n.fix&&n.fix(t)},k=()=>{const t=w(),n=I(t),r=T()?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",panelBg:"#222d3a",border:"#3b4657",text:"#e2e8f0",muted:"#9fb0c6",closeHover:"#334155",summaryBg:"#111827",issueBg:"#1f2937",issueHoverBg:"#273244",issueBorder:"#4b5563",issueHoverBorder:"#58a6ff",fixBtn:"#3b82f6",fixBtnHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",panelBg:"#ffffff",border:"#e0e0e0",text:"#1f2937",muted:"#666666",closeHover:"#f0f0f0",summaryBg:"#f5f5f5",issueBg:"#ffffff",issueHoverBg:"#f5f9ff",issueBorder:"#e0e0e0",issueHoverBorder:"#2196f3",fixBtn:"#2196f3",fixBtnHover:"#1976d2"},a=document.createElement("div");a.className="a11y-dialog-overlay",a.style.cssText=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=new Set,C=[],b=t=>{C.push(t)},v='[data-theme="dark"], .dark, .editora-theme-dark';b({id:"image-alt-text",wcag:"1.1.1",description:"Images must have alt text",severity:"error",selector:"img",evaluate(t,n){var r;const e=t;return e.hasAttribute("role")&&e.getAttribute("role")==="presentation"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="image-alt-text"?null:!e.hasAttribute("alt")||((r=e.getAttribute("alt"))==null?void 0:r.trim())===""?{id:`img-alt-${n.cache.get("imgIdx")}`,rule:"image-alt-text",wcag:"1.1.1",severity:"error",message:"Image missing alt text",nodePath:n.cache.get("imgPath"),element:e,suggestion:"Add descriptive alt text to all images",fixable:!0,fixLabel:"Add empty alt"}:null},fix(t){t.element&&t.element.setAttribute("alt","")}});b({id:"empty-interactive",wcag:"4.1.2",description:"Interactive elements must have accessible names",severity:"error",selector:'button, a, [role="button"]',evaluate(t,n){var c;const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="empty-interactive")return null;const r=(c=e.textContent)==null?void 0:c.trim(),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby"),s=e.hasAttribute("title");return!r&&!a&&!o&&!s?{id:`interactive-empty-${n.cache.get("buttonIdx")}`,rule:"empty-interactive",wcag:"4.1.2",severity:"error",message:"Interactive element has no accessible name",nodePath:n.cache.get("buttonPath"),element:e,suggestion:"Add text, aria-label, aria-labelledby, or title",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Button")}});b({id:"form-label",wcag:"1.3.1",description:"Form controls must have labels",severity:"error",selector:"input, textarea, select",evaluate(t,n){const e=t;if(e.hasAttribute("type")&&e.getAttribute("type")==="hidden"||e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="form-label")return null;const r=n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`),a=e.hasAttribute("aria-label"),o=e.hasAttribute("aria-labelledby");return!r&&!a&&!o?{id:`form-label-${n.cache.get("inputIdx")}`,rule:"form-label",wcag:"1.3.1",severity:"error",message:"Form control missing label",nodePath:n.cache.get("inputPath"),element:e,suggestion:"Add <label>, aria-label, or aria-labelledby",fixable:!0,fixLabel:"Add aria-label"}:null},fix(t){t.element&&t.element.setAttribute("aria-label","Input")}});b({id:"table-headers",wcag:"1.3.1",description:"Tables must have header rows",severity:"error",selector:"table",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="table-headers")return null;const r=e.querySelectorAll("th"),a=e.querySelectorAll("tr");return r.length===0&&a.length>0?{id:`table-no-headers-${n.cache.get("tableIdx")}`,rule:"table-headers",wcag:"1.3.1",severity:"error",message:"Table missing header row (<th> elements)",nodePath:n.cache.get("tablePath"),element:e,suggestion:"Add <th> elements to first row",fixable:!0,fixLabel:"Convert first row to headers"}:null},fix(t){if(t.element){const e=t.element.querySelector("tr");e&&Array.from(e.children).forEach(r=>{if(r.tagName==="TD"){const a=document.createElement("th");a.innerHTML=r.innerHTML,e.replaceChild(a,r)}})}}});b({id:"heading-empty",wcag:"1.3.1",description:"Headings must not be empty",severity:"error",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){var o;const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="heading-empty")return null;const r=((o=e.textContent)==null?void 0:o.replace(/\s+/g,""))||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR";return!r&&!a?{id:`heading-empty-${n.cache.get("headingIdx")}`,rule:"heading-empty",wcag:"1.3.1",severity:"error",message:`Empty ${e.tagName.toLowerCase()} heading`,nodePath:n.cache.get("headingPath"),element:e,suggestion:"All headings must contain text",fixable:!1}:null}});b({id:"heading-order",wcag:"1.3.1",description:"Headings should not skip levels",severity:"warning",selector:"h1, h2, h3, h4, h5, h6",evaluate(t,n){const e=t,r=parseInt(e.tagName[1]),a=n.cache.get("previousHeadingLevel")||r;return n.cache.set("previousHeadingLevel",r),r-a>1?{id:`heading-order-${n.cache.get("headingIdx")}`,rule:"heading-order",wcag:"1.3.1",severity:"warning",message:`Heading skips level (${a} → ${r})`,nodePath:n.cache.get("headingPath"),element:e,suggestion:`Use heading level ${a+1} instead`,fixable:!1}:null}});b({id:"link-text",wcag:"2.4.4",description:"Links must have descriptive text",severity:"error",selector:"a",evaluate(t,n){var s,c;const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="link-text")return null;const r=((s=e.textContent)==null?void 0:s.replace(/\s+/g,"").toLowerCase())||"",a=e.childNodes.length===1&&e.childNodes[0].nodeName==="BR",o=["clickhere","readmore","link","here","this","page"];return!r&&!a?{id:`link-empty-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"error",message:"Link has no text content",nodePath:n.cache.get("aPath"),element:e,suggestion:"All links must have descriptive text",fixable:!0,fixLabel:"Insert placeholder"}:o.some(h=>r.includes(h))?{id:`link-vague-${n.cache.get("aIdx")}`,rule:"link-text",wcag:"2.4.4",severity:"warning",message:`Vague link text: "${(c=e.textContent)==null?void 0:c.trim()}"`,nodePath:n.cache.get("aPath"),element:e,suggestion:"Use descriptive link text",fixable:!1}:null},fix(t){t.element&&(t.element.textContent="Link")}});b({id:"list-structure",wcag:"1.3.1",description:"Lists must only contain <li> children",severity:"error",selector:"ul, ol",evaluate(t,n){const e=t;if(e.hasAttribute("data-a11y-ignore")&&e.getAttribute("data-a11y-ignore")==="list-structure")return null;const r=e.querySelectorAll(":scope > li");return Array.from(e.children).filter(o=>o.tagName!=="LI").length>0?{id:`list-structure-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"error",message:"List contains non-li elements",nodePath:n.cache.get("ulPath"),element:e,suggestion:"All direct children of ul/ol must be li elements",fixable:!1}:r.length===0?{id:`list-empty-${n.cache.get("ulIdx")}`,rule:"list-structure",wcag:"1.3.1",severity:"warning",message:"Empty list element",nodePath:n.cache.get("ulPath"),element:e,suggestion:"Remove empty lists or add list items",fixable:!1}:null}});const A=()=>{const t=window.getSelection();if(t&&t.rangeCount>0){let e=t.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const r=e;if(r.getAttribute("contenteditable")==="true")return r}e=e.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const e=n.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},T=()=>{const t=A();if(t!=null&&t.closest(v))return!0;const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).startContainer,a=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;if(a!=null&&a.closest(v))return!0}const e=document.activeElement;return e!=null&&e.closest(v)?!0:document.body.matches(v)||document.documentElement.matches(v)},w=()=>{var h,u,y;const t=A();if(!t)return[];const n=[],e={doc:t.ownerDocument||document,cache:new Map},r=e.doc.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let a=r.currentNode,o={},s={},c=0;for(;a&&c<5e3;){const f=a,i=((u=(h=f.tagName)==null?void 0:h.toLowerCase)==null?void 0:u.call(h))||"";if(f.hidden||f.style.display==="none"||f.style.visibility==="hidden"){a=r.nextNode(),c++;continue}o[i]=(o[i]||0)+1,s[i]=`${i}[${o[i]-1}]`;for(const d of C){if(B.has(d.id)||d.selector&&!((y=a.matches)!=null&&y.call(a,d.selector)))continue;e.cache.set(`${i}Idx`,o[i]-1),e.cache.set(`${i}Path`,s[i]),/^h[1-6]$/.test(i)&&(e.cache.set("headingIdx",o[i]-1),e.cache.set("headingPath",s[i])),i==="a"&&(e.cache.set("aIdx",o[i]-1),e.cache.set("aPath",s[i])),i==="table"&&(e.cache.set("tableIdx",o[i]-1),e.cache.set("tablePath",s[i])),i==="button"&&(e.cache.set("buttonIdx",o[i]-1),e.cache.set("buttonPath",s[i])),i==="input"&&(e.cache.set("inputIdx",o[i]-1),e.cache.set("inputPath",s[i])),(i==="ul"||i==="ol")&&(e.cache.set("ulIdx",o[i]-1),e.cache.set("ulPath",s[i]));const p=d.evaluate(a,e);p&&n.push(p)}a=r.nextNode(),c++}return n},x=(t,n=!0)=>{t.element&&(n?(t.element.classList.add("a11y-highlighted"),t.element.style.outline="2px solid #ff9800",t.element.style.backgroundColor="#fff3cd"):(t.element.classList.remove("a11y-highlighted"),t.element.style.outline="",t.element.style.backgroundColor=""))},I=t=>{t||(t=w());const n=t.filter(a=>a.severity==="error").length,e=t.filter(a=>a.severity==="warning").length;let r=100-n*20-e*5;return Math.max(0,r)},P=t=>{const n=C.find(e=>e.id===t.rule);n&&n.fix&&n.fix(t)},k=()=>{const t=w(),n=I(t),r=T()?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",panelBg:"#222d3a",border:"#3b4657",text:"#e2e8f0",muted:"#9fb0c6",closeHover:"#334155",summaryBg:"#111827",issueBg:"#1f2937",issueHoverBg:"#273244",issueBorder:"#4b5563",issueHoverBorder:"#58a6ff",fixBtn:"#3b82f6",fixBtnHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",panelBg:"#ffffff",border:"#e0e0e0",text:"#1f2937",muted:"#666666",closeHover:"#f0f0f0",summaryBg:"#f5f5f5",issueBg:"#ffffff",issueHoverBg:"#f5f9ff",issueBorder:"#e0e0e0",issueHoverBorder:"#2196f3",fixBtn:"#2196f3",fixBtnHover:"#1976d2"},a=document.createElement("div");a.className="a11y-dialog-overlay",a.style.cssText=`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -27,14 +27,14 @@
27
27
  display: flex;
28
28
  align-items: center;
29
29
  justify-content: space-between;
30
- `;const p=document.createElement("h2");p.style.cssText=`margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`,p.textContent="Accessibility Checker";const h=document.createElement("div");h.style.cssText=`
30
+ `;const c=document.createElement("h2");c.style.cssText=`margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`,c.textContent="Accessibility Checker";const h=document.createElement("div");h.style.cssText=`
31
31
  font-size: 24px;
32
32
  font-weight: bold;
33
33
  padding: 8px 16px;
34
34
  border-radius: 4px;
35
35
  background: ${n>=80?"#4caf50":n>=60?"#ff9800":"#f44336"};
36
36
  color: white;
37
- `,h.textContent=`${n}/100`;const i=document.createElement("button");i.textContent="✕",i.style.cssText=`
37
+ `,h.textContent=`${n}/100`;const u=document.createElement("button");u.textContent="✕",u.style.cssText=`
38
38
  background: none;
39
39
  border: none;
40
40
  font-size: 24px;
@@ -47,18 +47,18 @@
47
47
  justify-content: center;
48
48
  border-radius: 4px;
49
49
  color: ${r.muted};
50
- `,i.onmouseover=()=>{i.style.background=r.closeHover,i.style.color="#f8fafc"},i.onmouseout=()=>{i.style.background="none",i.style.color=r.muted},i.onclick=()=>{t.forEach(g=>b(g,!1)),a.remove()};const u=document.createElement("div");u.style.cssText="display: flex; align-items: center; gap: 16px;",u.appendChild(p),u.appendChild(h),s.appendChild(u),s.appendChild(i);const m=document.createElement("div");if(m.style.cssText=`
50
+ `,u.onmouseover=()=>{u.style.background=r.closeHover,u.style.color="#f8fafc"},u.onmouseout=()=>{u.style.background="none",u.style.color=r.muted},u.onclick=()=>{t.forEach(d=>x(d,!1)),a.remove()};const y=document.createElement("div");y.style.cssText="display: flex; align-items: center; gap: 16px;",y.appendChild(c),y.appendChild(h),s.appendChild(y),s.appendChild(u);const f=document.createElement("div");if(f.style.cssText=`
51
51
  flex: 1;
52
52
  overflow-y: auto;
53
53
  padding: 20px;
54
54
  background: ${r.dialogBg};
55
- `,t.length===0)m.innerHTML=`
55
+ `,t.length===0)f.innerHTML=`
56
56
  <div style="text-align: center; padding: 40px 20px;">
57
57
  <div style="font-size: 48px; margin-bottom: 16px;">✅</div>
58
58
  <h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
59
59
  <p style="margin: 0; color: ${r.muted};">Your content meets WCAG 2.1 AA standards.</p>
60
60
  </div>
61
- `;else{const g=document.createElement("div");g.style.cssText=`
61
+ `;else{const d=document.createElement("div");d.style.cssText=`
62
62
  background: ${r.summaryBg};
63
63
  border: 1px solid ${r.border};
64
64
  padding: 12px 16px;
@@ -66,11 +66,11 @@
66
66
  margin-bottom: 20px;
67
67
  display: flex;
68
68
  gap: 20px;
69
- `;const y=t.filter(l=>l.severity==="error").length,$=t.filter(l=>l.severity==="warning").length,E=t.filter(l=>l.severity==="info").length;g.innerHTML=`
70
- <div><strong style="color: #f44336;">${y}</strong> <span style="color: ${r.muted};">Errors</span></div>
69
+ `;const p=t.filter(l=>l.severity==="error").length,$=t.filter(l=>l.severity==="warning").length,E=t.filter(l=>l.severity==="info").length;d.innerHTML=`
70
+ <div><strong style="color: #f44336;">${p}</strong> <span style="color: ${r.muted};">Errors</span></div>
71
71
  <div><strong style="color: #ff9800;">${$}</strong> <span style="color: ${r.muted};">Warnings</span></div>
72
72
  <div><strong style="color: #2196f3;">${E}</strong> <span style="color: ${r.muted};">Info</span></div>
73
- `,m.appendChild(g),t.forEach(l=>{const c=document.createElement("div");c.style.cssText=`
73
+ `,f.appendChild(d),t.forEach(l=>{const m=document.createElement("div");m.style.cssText=`
74
74
  border: 1px solid ${r.issueBorder};
75
75
  border-radius: 6px;
76
76
  padding: 16px;
@@ -78,7 +78,7 @@
78
78
  transition: all 0.2s;
79
79
  background: ${r.issueBg};
80
80
  color: ${r.text};
81
- `,c.onmouseover=()=>{c.style.borderColor=r.issueHoverBorder,c.style.background=r.issueHoverBg,b(l,!0)},c.onmouseout=()=>{c.style.borderColor=r.issueBorder,c.style.background=r.issueBg,b(l,!1)};const L=l.severity==="error"?"#f44336":l.severity==="warning"?"#ff9800":"#2196f3";if(c.innerHTML=`
81
+ `,m.onmouseover=()=>{m.style.borderColor=r.issueHoverBorder,m.style.background=r.issueHoverBg,x(l,!0)},m.onmouseout=()=>{m.style.borderColor=r.issueBorder,m.style.background=r.issueBg,x(l,!1)};const L=l.severity==="error"?"#f44336":l.severity==="warning"?"#ff9800":"#2196f3";if(m.innerHTML=`
82
82
  <div style="display: flex; align-items: start; gap: 12px; margin-bottom: 8px;">
83
83
  <span style="
84
84
  background: ${L};
@@ -97,7 +97,7 @@
97
97
  <div style="font-size: 14px; color: ${r.text}; margin-bottom: 8px; padding-left: 68px;">
98
98
  ${l.suggestion||""}
99
99
  </div>
100
- `,l.fixable){const d=document.createElement("button");d.textContent=`🔧 ${l.fixLabel||"Auto-fix"}`,d.style.cssText=`
100
+ `,l.fixable){const g=document.createElement("button");g.textContent=`🔧 ${l.fixLabel||"Auto-fix"}`,g.style.cssText=`
101
101
  background: ${r.fixBtn};
102
102
  color: white;
103
103
  border: none;
@@ -106,4 +106,4 @@
106
106
  cursor: pointer;
107
107
  font-size: 13px;
108
108
  margin-left: 68px;
109
- `,d.onmouseover=()=>d.style.background=r.fixBtnHover,d.onmouseout=()=>d.style.background=r.fixBtn,d.onclick=()=>{P(l),d.textContent="✓ Fixed",d.style.background="#4caf50",d.disabled=!0,d.style.cursor="not-allowed",b(l,!1),setTimeout(()=>{a.remove(),k()},1e3)},c.appendChild(d)}m.appendChild(c)})}o.appendChild(s),o.appendChild(m),a.appendChild(o),document.body.appendChild(a),a.onclick=g=>{g.target===a&&(t.forEach(y=>b(y,!1)),a.remove())};const C=g=>{g.key==="Escape"&&(t.forEach(y=>b(y,!1)),a.remove(),document.removeEventListener("keydown",C))};document.addEventListener("keydown",C)},H=()=>({name:"a11yChecker",toolbar:[{label:"Accessibility",command:"toggleA11yChecker",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M9 6.82954C10.1652 6.4177 11 5.30646 11 4.00024C11 2.34339 9.65686 1.00024 8 1.00024C6.34315 1.00024 5 2.34339 5 4.00024C5 5.30646 5.83481 6.4177 7 6.82954V12.0002C7 13.6571 8.34315 15.0002 10 15.0002H14.9296C15.264 15.0002 15.5762 15.1673 15.7617 15.4455L18.4913 19.54C19.1914 20.5901 20.6772 20.7373 21.5696 19.8448L22.7071 18.7074C23.0976 18.3168 23.0976 17.6837 22.7071 17.2931C22.3166 16.9026 21.6834 16.9026 21.2929 17.2931L20.1554 18.4306L17.4258 14.3361C16.8694 13.5015 15.9327 13.0002 14.9296 13.0002H10C9.44772 13.0002 9 12.5525 9 12.0002V11.0002H15C15.5523 11.0002 16 10.5525 16 10.0002C16 9.44796 15.5523 9.00025 15 9.00025H9V6.82954ZM8 5.10758C7.38844 5.10758 6.89267 4.61181 6.89267 4.00024C6.89267 3.38868 7.38844 2.89291 8 2.89291C8.61157 2.89291 9.10734 3.38868 9.10734 4.00024C9.10734 4.61181 8.61157 5.10758 8 5.10758Z" fill="#0F0F0F"></path> <path d="M4.6328 9.07414C5.10517 8.78987 5.69738 9.0279 5.91645 9.53381C6.13552 10.0397 5.89604 10.6205 5.43795 10.9272C4.92993 11.2673 4.48018 11.6911 4.10882 12.1826C3.53598 12.9408 3.16922 13.8345 3.04425 14.7765C2.91928 15.7185 3.04036 16.6768 3.3957 17.5582C3.75103 18.4395 4.32852 19.2138 5.07194 19.8058C5.81535 20.3977 6.69937 20.787 7.63791 20.9359C8.57646 21.0847 9.53756 20.988 10.4276 20.6552C11.3177 20.3223 12.1065 19.7647 12.7171 19.0366C13.1129 18.5645 13.4251 18.0313 13.6428 17.46C13.8391 16.9448 14.3514 16.5813 14.8936 16.6815C15.4357 16.7816 15.8004 17.3054 15.6291 17.8295C15.3326 18.7372 14.8644 19.583 14.2468 20.3194C13.4147 21.3117 12.3399 22.0716 11.1269 22.5252C9.91394 22.9787 8.6042 23.1105 7.32518 22.9077C6.04617 22.7048 4.84148 22.1742 3.82838 21.3676C2.81528 20.561 2.02831 19.5058 1.54407 18.3047C1.05983 17.1037 0.894836 15.7977 1.06514 14.5139C1.23545 13.2302 1.73525 12.0124 2.51589 10.9791C3.09523 10.2123 3.81459 9.56654 4.6328 9.07414Z" fill="#0F0F0F"></path> </g></svg>',shortcut:"Mod-Shift-Alt-a"}],commands:{toggleA11yChecker:()=>{try{return k(),!0}catch(t){return console.error("Failed to open accessibility checker:",t),!1}}},keymap:{"Mod-Shift-Alt-a":"toggleA11yChecker"}});exports.A11yCheckerPlugin=H;
109
+ `,g.onmouseover=()=>g.style.background=r.fixBtnHover,g.onmouseout=()=>g.style.background=r.fixBtn,g.onclick=()=>{P(l),g.textContent="✓ Fixed",g.style.background="#4caf50",g.disabled=!0,g.style.cursor="not-allowed",x(l,!1),setTimeout(()=>{a.remove(),k()},1e3)},m.appendChild(g)}f.appendChild(m)})}o.appendChild(s),o.appendChild(f),a.appendChild(o),document.body.appendChild(a),a.onclick=d=>{d.target===a&&(t.forEach(p=>x(p,!1)),a.remove())};const i=d=>{d.key==="Escape"&&(t.forEach(p=>x(p,!1)),a.remove(),document.removeEventListener("keydown",i))};document.addEventListener("keydown",i)},H=()=>({name:"a11yChecker",toolbar:[{label:"Accessibility",command:"toggleA11yChecker",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M9 6.82954C10.1652 6.4177 11 5.30646 11 4.00024C11 2.34339 9.65686 1.00024 8 1.00024C6.34315 1.00024 5 2.34339 5 4.00024C5 5.30646 5.83481 6.4177 7 6.82954V12.0002C7 13.6571 8.34315 15.0002 10 15.0002H14.9296C15.264 15.0002 15.5762 15.1673 15.7617 15.4455L18.4913 19.54C19.1914 20.5901 20.6772 20.7373 21.5696 19.8448L22.7071 18.7074C23.0976 18.3168 23.0976 17.6837 22.7071 17.2931C22.3166 16.9026 21.6834 16.9026 21.2929 17.2931L20.1554 18.4306L17.4258 14.3361C16.8694 13.5015 15.9327 13.0002 14.9296 13.0002H10C9.44772 13.0002 9 12.5525 9 12.0002V11.0002H15C15.5523 11.0002 16 10.5525 16 10.0002C16 9.44796 15.5523 9.00025 15 9.00025H9V6.82954ZM8 5.10758C7.38844 5.10758 6.89267 4.61181 6.89267 4.00024C6.89267 3.38868 7.38844 2.89291 8 2.89291C8.61157 2.89291 9.10734 3.38868 9.10734 4.00024C9.10734 4.61181 8.61157 5.10758 8 5.10758Z" fill="#0F0F0F"></path> <path d="M4.6328 9.07414C5.10517 8.78987 5.69738 9.0279 5.91645 9.53381C6.13552 10.0397 5.89604 10.6205 5.43795 10.9272C4.92993 11.2673 4.48018 11.6911 4.10882 12.1826C3.53598 12.9408 3.16922 13.8345 3.04425 14.7765C2.91928 15.7185 3.04036 16.6768 3.3957 17.5582C3.75103 18.4395 4.32852 19.2138 5.07194 19.8058C5.81535 20.3977 6.69937 20.787 7.63791 20.9359C8.57646 21.0847 9.53756 20.988 10.4276 20.6552C11.3177 20.3223 12.1065 19.7647 12.7171 19.0366C13.1129 18.5645 13.4251 18.0313 13.6428 17.46C13.8391 16.9448 14.3514 16.5813 14.8936 16.6815C15.4357 16.7816 15.8004 17.3054 15.6291 17.8295C15.3326 18.7372 14.8644 19.583 14.2468 20.3194C13.4147 21.3117 12.3399 22.0716 11.1269 22.5252C9.91394 22.9787 8.6042 23.1105 7.32518 22.9077C6.04617 22.7048 4.84148 22.1742 3.82838 21.3676C2.81528 20.561 2.02831 19.5058 1.54407 18.3047C1.05983 17.1037 0.894836 15.7977 1.06514 14.5139C1.23545 13.2302 1.73525 12.0124 2.51589 10.9791C3.09523 10.2123 3.81459 9.56654 4.6328 9.07414Z" fill="#0F0F0F"></path> </g></svg>',shortcut:"Mod-Shift-Alt-a"}],commands:{toggleA11yChecker:()=>{try{return k(),!0}catch(t){return console.error("Failed to open accessibility checker:",t),!1}}},keymap:{"Mod-Shift-Alt-a":"toggleA11yChecker"}});exports.A11yCheckerPlugin=H;
@@ -1,15 +1,16 @@
1
- const B = /* @__PURE__ */ new Set(), v = [], f = (t) => {
2
- v.push(t);
3
- }, x = '[data-theme="dark"], .dark, .editora-theme-dark';
4
- f({
1
+ const B = /* @__PURE__ */ new Set(), C = [], b = (t) => {
2
+ C.push(t);
3
+ }, v = '[data-theme="dark"], .dark, .editora-theme-dark';
4
+ b({
5
5
  id: "image-alt-text",
6
6
  wcag: "1.1.1",
7
7
  description: "Images must have alt text",
8
8
  severity: "error",
9
9
  selector: "img",
10
10
  evaluate(t, n) {
11
+ var r;
11
12
  const e = t;
12
- return e.hasAttribute("role") && e.getAttribute("role") === "presentation" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "image-alt-text" ? null : !e.hasAttribute("alt") || e.getAttribute("alt")?.trim() === "" ? {
13
+ return e.hasAttribute("role") && e.getAttribute("role") === "presentation" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "image-alt-text" ? null : !e.hasAttribute("alt") || ((r = e.getAttribute("alt")) == null ? void 0 : r.trim()) === "" ? {
13
14
  id: `img-alt-${n.cache.get("imgIdx")}`,
14
15
  rule: "image-alt-text",
15
16
  wcag: "1.1.1",
@@ -26,16 +27,18 @@ f({
26
27
  t.element && t.element.setAttribute("alt", "");
27
28
  }
28
29
  });
29
- f({
30
+ b({
30
31
  id: "empty-interactive",
31
32
  wcag: "4.1.2",
32
33
  description: "Interactive elements must have accessible names",
33
34
  severity: "error",
34
35
  selector: 'button, a, [role="button"]',
35
36
  evaluate(t, n) {
37
+ var c;
36
38
  const e = t;
37
- if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "empty-interactive") return null;
38
- const r = e.textContent?.trim(), a = e.hasAttribute("aria-label"), o = e.hasAttribute("aria-labelledby"), s = e.hasAttribute("title");
39
+ if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "empty-interactive")
40
+ return null;
41
+ const r = (c = e.textContent) == null ? void 0 : c.trim(), a = e.hasAttribute("aria-label"), o = e.hasAttribute("aria-labelledby"), s = e.hasAttribute("title");
39
42
  return !r && !a && !o && !s ? {
40
43
  id: `interactive-empty-${n.cache.get("buttonIdx")}`,
41
44
  rule: "empty-interactive",
@@ -53,7 +56,7 @@ f({
53
56
  t.element && t.element.setAttribute("aria-label", "Button");
54
57
  }
55
58
  });
56
- f({
59
+ b({
57
60
  id: "form-label",
58
61
  wcag: "1.3.1",
59
62
  description: "Form controls must have labels",
@@ -61,7 +64,8 @@ f({
61
64
  selector: "input, textarea, select",
62
65
  evaluate(t, n) {
63
66
  const e = t;
64
- if (e.hasAttribute("type") && e.getAttribute("type") === "hidden" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "form-label") return null;
67
+ if (e.hasAttribute("type") && e.getAttribute("type") === "hidden" || e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "form-label")
68
+ return null;
65
69
  const r = n.doc.querySelector(`label[for="${e.getAttribute("id")}"]`), a = e.hasAttribute("aria-label"), o = e.hasAttribute("aria-labelledby");
66
70
  return !r && !a && !o ? {
67
71
  id: `form-label-${n.cache.get("inputIdx")}`,
@@ -80,7 +84,7 @@ f({
80
84
  t.element && t.element.setAttribute("aria-label", "Input");
81
85
  }
82
86
  });
83
- f({
87
+ b({
84
88
  id: "table-headers",
85
89
  wcag: "1.3.1",
86
90
  description: "Tables must have header rows",
@@ -88,7 +92,8 @@ f({
88
92
  selector: "table",
89
93
  evaluate(t, n) {
90
94
  const e = t;
91
- if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "table-headers") return null;
95
+ if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "table-headers")
96
+ return null;
92
97
  const r = e.querySelectorAll("th"), a = e.querySelectorAll("tr");
93
98
  return r.length === 0 && a.length > 0 ? {
94
99
  id: `table-no-headers-${n.cache.get("tableIdx")}`,
@@ -115,16 +120,18 @@ f({
115
120
  }
116
121
  }
117
122
  });
118
- f({
123
+ b({
119
124
  id: "heading-empty",
120
125
  wcag: "1.3.1",
121
126
  description: "Headings must not be empty",
122
127
  severity: "error",
123
128
  selector: "h1, h2, h3, h4, h5, h6",
124
129
  evaluate(t, n) {
130
+ var o;
125
131
  const e = t;
126
- if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "heading-empty") return null;
127
- const r = e.textContent?.replace(/\s+/g, "") || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR";
132
+ if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "heading-empty")
133
+ return null;
134
+ const r = ((o = e.textContent) == null ? void 0 : o.replace(/\s+/g, "")) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR";
128
135
  return !r && !a ? {
129
136
  id: `heading-empty-${n.cache.get("headingIdx")}`,
130
137
  rule: "heading-empty",
@@ -138,7 +145,7 @@ f({
138
145
  } : null;
139
146
  }
140
147
  });
141
- f({
148
+ b({
142
149
  id: "heading-order",
143
150
  wcag: "1.3.1",
144
151
  description: "Headings should not skip levels",
@@ -159,16 +166,18 @@ f({
159
166
  } : null;
160
167
  }
161
168
  });
162
- f({
169
+ b({
163
170
  id: "link-text",
164
171
  wcag: "2.4.4",
165
172
  description: "Links must have descriptive text",
166
173
  severity: "error",
167
174
  selector: "a",
168
175
  evaluate(t, n) {
176
+ var s, c;
169
177
  const e = t;
170
- if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "link-text") return null;
171
- const r = e.textContent?.replace(/\s+/g, "").toLowerCase() || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR", o = ["clickhere", "readmore", "link", "here", "this", "page"];
178
+ if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "link-text")
179
+ return null;
180
+ const r = ((s = e.textContent) == null ? void 0 : s.replace(/\s+/g, "").toLowerCase()) || "", a = e.childNodes.length === 1 && e.childNodes[0].nodeName === "BR", o = ["clickhere", "readmore", "link", "here", "this", "page"];
172
181
  return !r && !a ? {
173
182
  id: `link-empty-${n.cache.get("aIdx")}`,
174
183
  rule: "link-text",
@@ -180,12 +189,12 @@ f({
180
189
  suggestion: "All links must have descriptive text",
181
190
  fixable: !0,
182
191
  fixLabel: "Insert placeholder"
183
- } : o.some((s) => r.includes(s)) ? {
192
+ } : o.some((h) => r.includes(h)) ? {
184
193
  id: `link-vague-${n.cache.get("aIdx")}`,
185
194
  rule: "link-text",
186
195
  wcag: "2.4.4",
187
196
  severity: "warning",
188
- message: `Vague link text: "${e.textContent?.trim()}"`,
197
+ message: `Vague link text: "${(c = e.textContent) == null ? void 0 : c.trim()}"`,
189
198
  nodePath: n.cache.get("aPath"),
190
199
  element: e,
191
200
  suggestion: "Use descriptive link text",
@@ -196,7 +205,7 @@ f({
196
205
  t.element && (t.element.textContent = "Link");
197
206
  }
198
207
  });
199
- f({
208
+ b({
200
209
  id: "list-structure",
201
210
  wcag: "1.3.1",
202
211
  description: "Lists must only contain <li> children",
@@ -204,7 +213,8 @@ f({
204
213
  selector: "ul, ol",
205
214
  evaluate(t, n) {
206
215
  const e = t;
207
- if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "list-structure") return null;
216
+ if (e.hasAttribute("data-a11y-ignore") && e.getAttribute("data-a11y-ignore") === "list-structure")
217
+ return null;
208
218
  const r = e.querySelectorAll(":scope > li");
209
219
  return Array.from(e.children).filter((o) => o.tagName !== "LI").length > 0 ? {
210
220
  id: `list-structure-${n.cache.get("ulIdx")}`,
@@ -247,39 +257,47 @@ const A = () => {
247
257
  if (n.getAttribute("contenteditable") === "true")
248
258
  return n;
249
259
  const e = n.closest('[contenteditable="true"]');
250
- if (e) return e;
260
+ if (e)
261
+ return e;
251
262
  }
252
263
  return document.querySelector('[contenteditable="true"]');
253
264
  }, T = () => {
254
- if (A()?.closest(x)) return !0;
265
+ const t = A();
266
+ if (t != null && t.closest(v))
267
+ return !0;
255
268
  const n = window.getSelection();
256
269
  if (n && n.rangeCount > 0) {
257
- const r = n.getRangeAt(0).startContainer;
258
- if ((r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement)?.closest(x)) return !0;
270
+ const r = n.getRangeAt(0).startContainer, a = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement;
271
+ if (a != null && a.closest(v))
272
+ return !0;
259
273
  }
260
- return document.activeElement?.closest(x) ? !0 : document.body.matches(x) || document.documentElement.matches(x);
274
+ const e = document.activeElement;
275
+ return e != null && e.closest(v) ? !0 : document.body.matches(v) || document.documentElement.matches(v);
261
276
  }, w = () => {
277
+ var h, u, y;
262
278
  const t = A();
263
- if (!t) return [];
279
+ if (!t)
280
+ return [];
264
281
  const n = [], e = { doc: t.ownerDocument || document, cache: /* @__PURE__ */ new Map() }, r = e.doc.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, null);
265
- let a = r.currentNode, o = {}, s = {}, p = 0;
266
- for (; a && p < 5e3; ) {
267
- const h = a, i = h.tagName?.toLowerCase?.() || "";
268
- if (h.hidden || h.style.display === "none" || h.style.visibility === "hidden") {
269
- a = r.nextNode(), p++;
282
+ let a = r.currentNode, o = {}, s = {}, c = 0;
283
+ for (; a && c < 5e3; ) {
284
+ const f = a, i = ((u = (h = f.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : u.call(h)) || "";
285
+ if (f.hidden || f.style.display === "none" || f.style.visibility === "hidden") {
286
+ a = r.nextNode(), c++;
270
287
  continue;
271
288
  }
272
289
  o[i] = (o[i] || 0) + 1, s[i] = `${i}[${o[i] - 1}]`;
273
- for (const u of v) {
274
- if (B.has(u.id) || u.selector && !a.matches?.(u.selector)) continue;
290
+ for (const d of C) {
291
+ if (B.has(d.id) || d.selector && !((y = a.matches) != null && y.call(a, d.selector)))
292
+ continue;
275
293
  e.cache.set(`${i}Idx`, o[i] - 1), e.cache.set(`${i}Path`, s[i]), /^h[1-6]$/.test(i) && (e.cache.set("headingIdx", o[i] - 1), e.cache.set("headingPath", s[i])), i === "a" && (e.cache.set("aIdx", o[i] - 1), e.cache.set("aPath", s[i])), i === "table" && (e.cache.set("tableIdx", o[i] - 1), e.cache.set("tablePath", s[i])), i === "button" && (e.cache.set("buttonIdx", o[i] - 1), e.cache.set("buttonPath", s[i])), i === "input" && (e.cache.set("inputIdx", o[i] - 1), e.cache.set("inputPath", s[i])), (i === "ul" || i === "ol") && (e.cache.set("ulIdx", o[i] - 1), e.cache.set("ulPath", s[i]));
276
- const m = u.evaluate(a, e);
277
- m && n.push(m);
294
+ const p = d.evaluate(a, e);
295
+ p && n.push(p);
278
296
  }
279
- a = r.nextNode(), p++;
297
+ a = r.nextNode(), c++;
280
298
  }
281
299
  return n;
282
- }, b = (t, n = !0) => {
300
+ }, x = (t, n = !0) => {
283
301
  t.element && (n ? (t.element.classList.add("a11y-highlighted"), t.element.style.outline = "2px solid #ff9800", t.element.style.backgroundColor = "#fff3cd") : (t.element.classList.remove("a11y-highlighted"), t.element.style.outline = "", t.element.style.backgroundColor = ""));
284
302
  }, I = (t) => {
285
303
  t || (t = w());
@@ -287,7 +305,7 @@ const A = () => {
287
305
  let r = 100 - n * 20 - e * 5;
288
306
  return Math.max(0, r);
289
307
  }, H = (t) => {
290
- const n = v.find((e) => e.id === t.rule);
308
+ const n = C.find((e) => e.id === t.rule);
291
309
  n && n.fix && n.fix(t);
292
310
  }, k = () => {
293
311
  const t = w(), n = I(t), r = T() ? {
@@ -355,8 +373,8 @@ const A = () => {
355
373
  align-items: center;
356
374
  justify-content: space-between;
357
375
  `;
358
- const p = document.createElement("h2");
359
- p.style.cssText = `margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`, p.textContent = "Accessibility Checker";
376
+ const c = document.createElement("h2");
377
+ c.style.cssText = `margin: 0; font-size: 20px; font-weight: 600; color: ${r.text};`, c.textContent = "Accessibility Checker";
360
378
  const h = document.createElement("div");
361
379
  h.style.cssText = `
362
380
  font-size: 24px;
@@ -366,8 +384,8 @@ const A = () => {
366
384
  background: ${n >= 80 ? "#4caf50" : n >= 60 ? "#ff9800" : "#f44336"};
367
385
  color: white;
368
386
  `, h.textContent = `${n}/100`;
369
- const i = document.createElement("button");
370
- i.textContent = "✕", i.style.cssText = `
387
+ const u = document.createElement("button");
388
+ u.textContent = "✕", u.style.cssText = `
371
389
  background: none;
372
390
  border: none;
373
391
  font-size: 24px;
@@ -380,23 +398,23 @@ const A = () => {
380
398
  justify-content: center;
381
399
  border-radius: 4px;
382
400
  color: ${r.muted};
383
- `, i.onmouseover = () => {
384
- i.style.background = r.closeHover, i.style.color = "#f8fafc";
385
- }, i.onmouseout = () => {
386
- i.style.background = "none", i.style.color = r.muted;
387
- }, i.onclick = () => {
388
- t.forEach((g) => b(g, !1)), a.remove();
401
+ `, u.onmouseover = () => {
402
+ u.style.background = r.closeHover, u.style.color = "#f8fafc";
403
+ }, u.onmouseout = () => {
404
+ u.style.background = "none", u.style.color = r.muted;
405
+ }, u.onclick = () => {
406
+ t.forEach((d) => x(d, !1)), a.remove();
389
407
  };
390
- const u = document.createElement("div");
391
- u.style.cssText = "display: flex; align-items: center; gap: 16px;", u.appendChild(p), u.appendChild(h), s.appendChild(u), s.appendChild(i);
392
- const m = document.createElement("div");
393
- if (m.style.cssText = `
408
+ const y = document.createElement("div");
409
+ y.style.cssText = "display: flex; align-items: center; gap: 16px;", y.appendChild(c), y.appendChild(h), s.appendChild(y), s.appendChild(u);
410
+ const f = document.createElement("div");
411
+ if (f.style.cssText = `
394
412
  flex: 1;
395
413
  overflow-y: auto;
396
414
  padding: 20px;
397
415
  background: ${r.dialogBg};
398
416
  `, t.length === 0)
399
- m.innerHTML = `
417
+ f.innerHTML = `
400
418
  <div style="text-align: center; padding: 40px 20px;">
401
419
  <div style="font-size: 48px; margin-bottom: 16px;">✅</div>
402
420
  <h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
@@ -404,8 +422,8 @@ const A = () => {
404
422
  </div>
405
423
  `;
406
424
  else {
407
- const g = document.createElement("div");
408
- g.style.cssText = `
425
+ const d = document.createElement("div");
426
+ d.style.cssText = `
409
427
  background: ${r.summaryBg};
410
428
  border: 1px solid ${r.border};
411
429
  padding: 12px 16px;
@@ -414,14 +432,14 @@ const A = () => {
414
432
  display: flex;
415
433
  gap: 20px;
416
434
  `;
417
- const y = t.filter((l) => l.severity === "error").length, $ = t.filter((l) => l.severity === "warning").length, E = t.filter((l) => l.severity === "info").length;
418
- g.innerHTML = `
419
- <div><strong style="color: #f44336;">${y}</strong> <span style="color: ${r.muted};">Errors</span></div>
435
+ const p = t.filter((l) => l.severity === "error").length, $ = t.filter((l) => l.severity === "warning").length, E = t.filter((l) => l.severity === "info").length;
436
+ d.innerHTML = `
437
+ <div><strong style="color: #f44336;">${p}</strong> <span style="color: ${r.muted};">Errors</span></div>
420
438
  <div><strong style="color: #ff9800;">${$}</strong> <span style="color: ${r.muted};">Warnings</span></div>
421
439
  <div><strong style="color: #2196f3;">${E}</strong> <span style="color: ${r.muted};">Info</span></div>
422
- `, m.appendChild(g), t.forEach((l) => {
423
- const c = document.createElement("div");
424
- c.style.cssText = `
440
+ `, f.appendChild(d), t.forEach((l) => {
441
+ const m = document.createElement("div");
442
+ m.style.cssText = `
425
443
  border: 1px solid ${r.issueBorder};
426
444
  border-radius: 6px;
427
445
  padding: 16px;
@@ -429,13 +447,13 @@ const A = () => {
429
447
  transition: all 0.2s;
430
448
  background: ${r.issueBg};
431
449
  color: ${r.text};
432
- `, c.onmouseover = () => {
433
- c.style.borderColor = r.issueHoverBorder, c.style.background = r.issueHoverBg, b(l, !0);
434
- }, c.onmouseout = () => {
435
- c.style.borderColor = r.issueBorder, c.style.background = r.issueBg, b(l, !1);
450
+ `, m.onmouseover = () => {
451
+ m.style.borderColor = r.issueHoverBorder, m.style.background = r.issueHoverBg, x(l, !0);
452
+ }, m.onmouseout = () => {
453
+ m.style.borderColor = r.issueBorder, m.style.background = r.issueBg, x(l, !1);
436
454
  };
437
455
  const L = l.severity === "error" ? "#f44336" : l.severity === "warning" ? "#ff9800" : "#2196f3";
438
- if (c.innerHTML = `
456
+ if (m.innerHTML = `
439
457
  <div style="display: flex; align-items: start; gap: 12px; margin-bottom: 8px;">
440
458
  <span style="
441
459
  background: ${L};
@@ -455,8 +473,8 @@ const A = () => {
455
473
  ${l.suggestion || ""}
456
474
  </div>
457
475
  `, l.fixable) {
458
- const d = document.createElement("button");
459
- d.textContent = `🔧 ${l.fixLabel || "Auto-fix"}`, d.style.cssText = `
476
+ const g = document.createElement("button");
477
+ g.textContent = `🔧 ${l.fixLabel || "Auto-fix"}`, g.style.cssText = `
460
478
  background: ${r.fixBtn};
461
479
  color: white;
462
480
  border: none;
@@ -465,22 +483,22 @@ const A = () => {
465
483
  cursor: pointer;
466
484
  font-size: 13px;
467
485
  margin-left: 68px;
468
- `, d.onmouseover = () => d.style.background = r.fixBtnHover, d.onmouseout = () => d.style.background = r.fixBtn, d.onclick = () => {
469
- H(l), d.textContent = "✓ Fixed", d.style.background = "#4caf50", d.disabled = !0, d.style.cursor = "not-allowed", b(l, !1), setTimeout(() => {
486
+ `, g.onmouseover = () => g.style.background = r.fixBtnHover, g.onmouseout = () => g.style.background = r.fixBtn, g.onclick = () => {
487
+ H(l), g.textContent = "✓ Fixed", g.style.background = "#4caf50", g.disabled = !0, g.style.cursor = "not-allowed", x(l, !1), setTimeout(() => {
470
488
  a.remove(), k();
471
489
  }, 1e3);
472
- }, c.appendChild(d);
490
+ }, m.appendChild(g);
473
491
  }
474
- m.appendChild(c);
492
+ f.appendChild(m);
475
493
  });
476
494
  }
477
- o.appendChild(s), o.appendChild(m), a.appendChild(o), document.body.appendChild(a), a.onclick = (g) => {
478
- g.target === a && (t.forEach((y) => b(y, !1)), a.remove());
495
+ o.appendChild(s), o.appendChild(f), a.appendChild(o), document.body.appendChild(a), a.onclick = (d) => {
496
+ d.target === a && (t.forEach((p) => x(p, !1)), a.remove());
479
497
  };
480
- const C = (g) => {
481
- g.key === "Escape" && (t.forEach((y) => b(y, !1)), a.remove(), document.removeEventListener("keydown", C));
498
+ const i = (d) => {
499
+ d.key === "Escape" && (t.forEach((p) => x(p, !1)), a.remove(), document.removeEventListener("keydown", i));
482
500
  };
483
- document.addEventListener("keydown", C);
501
+ document.addEventListener("keydown", i);
484
502
  }, P = () => ({
485
503
  name: "a11yChecker",
486
504
  toolbar: [